<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Origami::Adobe::AddressBook</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Origami::Adobe::AddressBook</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/origami/parser_rb.html">
                origami/parser.rb
                </a>
        <br />
                <a href="../../../files/origami/adobe/addressbook_rb.html">
                origami/adobe/addressbook.rb
                </a>
        <br />
                <a href="../../../files/origami/adobe/header_rb.html">
                origami/adobe/header.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Class representing an <a href="../Adobe.html">Adobe</a> Reader certificate
store.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000326">&lt;&lt;</a>&nbsp;&nbsp;
      <a href="#M000327">Catalog</a>&nbsp;&nbsp;
      <a href="#M000335">add_certificate</a>&nbsp;&nbsp;
      <a href="#M000325">append_subobj</a>&nbsp;&nbsp;
      <a href="#M000332">get_cert</a>&nbsp;&nbsp;
      <a href="#M000324">objects</a>&nbsp;&nbsp;
      <a href="#M000328">saveas</a>&nbsp;&nbsp;
      <a href="#M000331">show_cert</a>&nbsp;&nbsp;
      <a href="#M000330">show_certs</a>&nbsp;&nbsp;
      <a href="#M000334">show_entries</a>&nbsp;&nbsp;
      <a href="#M000333">show_user</a>&nbsp;&nbsp;
      <a href="#M000329">show_users</a>&nbsp;&nbsp;
      <a href="#M000336">to_s</a>&nbsp;&nbsp;
      <a href="#M000337">to_str</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="AddressBook/Descriptor.html" class="link">Origami::Adobe::AddressBook::Descriptor</a><br />
Class <a href="AddressBook/AddressList.html" class="link">Origami::Adobe::AddressBook::AddressList</a><br />
Class <a href="AddressBook/Catalog.html" class="link">Origami::Adobe::AddressBook::Catalog</a><br />
Class <a href="AddressBook/Certificate.html" class="link">Origami::Adobe::AddressBook::Certificate</a><br />
Class <a href="AddressBook/Header.html" class="link">Origami::Adobe::AddressBook::Header</a><br />
Class <a href="AddressBook/PPK.html" class="link">Origami::Adobe::AddressBook::PPK</a><br />
Class <a href="AddressBook/Parser.html" class="link">Origami::Adobe::AddressBook::Parser</a><br />
Class <a href="AddressBook/Revision.html" class="link">Origami::Adobe::AddressBook::Revision</a><br />
Class <a href="AddressBook/User.html" class="link">Origami::Adobe::AddressBook::User</a><br />
Class <a href="AddressBook/UserList.html" class="link">Origami::Adobe::AddressBook::UserList</a><br />

    </div>

    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Size</td>
          <td>=</td>
          <td class="context-item-value">rev.body.size + 1</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Cert</td>
          <td>=</td>
          <td class="context-item-value">OpenSSL::X509::Certificate.new(certfile).to_der</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ID</td>
          <td>=</td>
          <td class="context-item-value">self.Catalog.PPK.AddressBook.NextID</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Trust</td>
          <td>=</td>
          <td class="context-item-value">attributes</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Viewable</td>
          <td>=</td>
          <td class="context-item-value">viewable</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Editable</td>
          <td>=</td>
          <td class="context-item-value">editable</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Size</td>
          <td>=</td>
          <td class="context-item-value">@revisions.first.body.size + 1</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">filename</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">header</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">revisions</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000326" class="method-detail">
        <a name="M000326"></a>

        <div class="method-heading">
          <a href="#M000326" class="method-signature">
          <span class="method-name">&lt;&lt;</span><span class="method-args">(object)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000326-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000326-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 107</span>
107:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">object</span>)
108:         
109:         <span class="ruby-identifier">object</span>.<span class="ruby-identifier">set_indirect</span>(<span class="ruby-keyword kw">true</span>)
110:         
111:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>.<span class="ruby-identifier">zero?</span>
112:         <span class="ruby-identifier">maxno</span> = <span class="ruby-value">1</span>
113:           <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">get_object</span>(<span class="ruby-identifier">maxno</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">maxno</span> = <span class="ruby-identifier">maxno</span>.<span class="ruby-identifier">succ</span> <span class="ruby-keyword kw">end</span>
114:           
115:           <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span> = <span class="ruby-value">0</span>
116:           <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> = <span class="ruby-identifier">maxno</span>
117:         <span class="ruby-keyword kw">end</span>
118:         
119:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>[<span class="ruby-identifier">object</span>.<span class="ruby-identifier">reference</span>] = <span class="ruby-identifier">object</span>
120:         
121:         <span class="ruby-identifier">object</span>.<span class="ruby-identifier">reference</span>
122:       <span class="ruby-keyword kw">end</span>
123:       
124:       <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Catalog</span>
125:         <span class="ruby-identifier">get_object</span>(<span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Root</span>)
126:       <span class="ruby-keyword kw">end</span>
127:       
128:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">saveas</span>(<span class="ruby-identifier">filename</span>)
129:         
130:         <span class="ruby-identifier">bin</span> = <span class="ruby-value str">&quot;&quot;</span>
131:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>
132: 
133:         <span class="ruby-identifier">lastno</span>, <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
134:           
135:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
136:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
137:  
138:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
139:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
140:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
141:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
142:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
143:           <span class="ruby-keyword kw">end</span>
144:           
145:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
146:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
147: 
148:           <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_s</span>
149:         }
150:         
151:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
152:         
153:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">xrefsection</span>
154:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
155:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-identifier">rev</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
156:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>
157: 
158:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@xreftable</span>.<span class="ruby-identifier">to_s</span>
159:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">to_s</span>
160: 
161:         <span class="ruby-identifier">fd</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>).<span class="ruby-identifier">binmode</span>
162:           <span class="ruby-identifier">fd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">bin</span> 
163:         <span class="ruby-identifier">fd</span>.<span class="ruby-identifier">close</span>
164:         
165:         <span class="ruby-identifier">show_entries</span>
166:       <span class="ruby-keyword kw">end</span>
167:       
168:       <span class="ruby-comment cmt">#</span>
169:       <span class="ruby-comment cmt"># Prints registered users in the address book</span>
170:       <span class="ruby-comment cmt">#</span>
171:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_users</span>
172:         
173:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
174:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Users list&quot;</span>
175:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
176:         
177:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
178:         
179:         <span class="ruby-keyword kw">nil</span>
180:       <span class="ruby-keyword kw">end</span>
181:       
182:       <span class="ruby-comment cmt">#</span>
183:       <span class="ruby-comment cmt"># Prints registered certificates in the addressbook</span>
184:       <span class="ruby-comment cmt">#</span>
185:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_certs</span>
186:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
187:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates list&quot;</span>
188:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
189:         
190:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
191:         
192:         <span class="ruby-keyword kw">nil</span>
193:       <span class="ruby-keyword kw">end</span>
194:       
195:       <span class="ruby-comment cmt">#</span>
196:       <span class="ruby-comment cmt"># Prints certificate with the specified id</span>
197:       <span class="ruby-comment cmt">#</span>
198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_cert</span>(<span class="ruby-identifier">id</span>)
199:         <span class="ruby-identifier">certs</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
200:         
201:         <span class="ruby-identifier">certs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cert</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> }
202:         
203:         <span class="ruby-keyword kw">nil</span>
204:       <span class="ruby-keyword kw">end</span>
205:       
206:       <span class="ruby-comment cmt">#</span>
207:       <span class="ruby-comment cmt"># Returns a Certificate dictionary corresponding to the specified id</span>
208:       <span class="ruby-comment cmt">#</span>
209:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_cert</span>(<span class="ruby-identifier">id</span>)
210:         
211:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
212:         
213:       <span class="ruby-keyword kw">end</span>
214:       
215:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_user</span>(<span class="ruby-identifier">id</span>)
216:         <span class="ruby-identifier">users</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
217:         
218:         <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> }
219:         
220:         <span class="ruby-keyword kw">nil</span>
221:       <span class="ruby-keyword kw">end</span>
222:       
223:       <span class="ruby-comment cmt">#</span>
224:       <span class="ruby-comment cmt"># Prints users and certificates registered in the address book</span>
225:       <span class="ruby-comment cmt">#</span>
226:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_entries</span>
227:         <span class="ruby-identifier">show_users</span>
228:         <span class="ruby-identifier">show_certs</span>
229:         
230:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;End of address book.&quot;</span>
231:       <span class="ruby-keyword kw">end</span>
232:       
233:       <span class="ruby-comment cmt">#</span>
234:       <span class="ruby-comment cmt"># Add a certificate into the address book</span>
235:       <span class="ruby-comment cmt">#</span>
236:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_certificate</span>(<span class="ruby-identifier">certfile</span>, <span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">viewable</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">editable</span> = <span class="ruby-keyword kw">false</span>)
237:         
238:         <span class="ruby-identifier">cert</span> = <span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>
239:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Cert</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">certfile</span>).<span class="ruby-identifier">to_der</span>
240:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">ID</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span>
241:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
242:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Trust</span> = <span class="ruby-identifier">attributes</span>
243:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Viewable</span> = <span class="ruby-identifier">viewable</span>
244:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Editable</span> = <span class="ruby-identifier">editable</span>
245:         
246:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">Entries</span>.<span class="ruby-identifier">push</span>(<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cert</span>)
247:         
248:         <span class="ruby-identifier">show_certs</span>
249:       <span class="ruby-keyword kw">end</span>
250:       
251:       <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">to_s</span> <span class="ruby-identifier">show_entries</span>
252:       <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">to_str</span> <span class="ruby-identifier">show_entries</span>
253:       
254:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">Catalog</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
255:         
256:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
257: 
258:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:Catalog</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
259:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:PPK</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
260:         
261:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
262:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
263:         <span class="ruby-keyword kw">end</span>
264:         
265:       <span class="ruby-keyword kw">end</span>
266:       
267:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">PPK</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
268:         
269:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
270: 
271:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:PPK</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
272:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:User</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
273:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:AddressBook</span>, <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
274:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:V</span>,           <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0x10001</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
275:         
276:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
277:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
278:         <span class="ruby-keyword kw">end</span>
279:         
280:       <span class="ruby-keyword kw">end</span>
281:       
282:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">UserList</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
283:         
284:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
285: 
286:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:User</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
287:         
288:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {})
289:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
290:         <span class="ruby-keyword kw">end</span>
291:         
292:       <span class="ruby-keyword kw">end</span>
293:       
294:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">AddressList</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
295:         
296:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
297: 
298:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:AddressBook</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
299:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:NextID</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>
300:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Entries</span>,     <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Array</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
301:         
302:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
303:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
304:         <span class="ruby-keyword kw">end</span>
305:         
306:       <span class="ruby-keyword kw">end</span>
307:       
308:       <span class="ruby-keyword kw">module</span> <span class="ruby-constant">Descriptor</span>
309:         
310:         <span class="ruby-constant">CERTIFICATE</span> = <span class="ruby-value">1</span>
311:         <span class="ruby-constant">USER</span> = <span class="ruby-value">2</span>
312: 
313:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">receiver</span>) <span class="ruby-comment cmt">#:nodoc:</span>
314:           <span class="ruby-identifier">receiver</span>.<span class="ruby-identifier">field</span>    <span class="ruby-identifier">:ID</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
315:           <span class="ruby-identifier">receiver</span>.<span class="ruby-identifier">field</span>    <span class="ruby-identifier">:ABEType</span>,   <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">CERTIFICATE</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
316:         <span class="ruby-keyword kw">end</span>
317:         
318:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
319:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
320:         <span class="ruby-keyword kw">end</span>
321:         
322:       <span class="ruby-keyword kw">end</span>
323:       
324:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">User</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
325:         
326:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
327:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Descriptor</span>
328: 
329:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:ABEType</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">USER</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
330:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Name</span>,          <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">String</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
331:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Encrypt</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>
332:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Certs</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Array</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
333:         
334:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
335:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ID: #{self.ID}&quot;</span>
336:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Name: #{self.Name}&quot;</span>
337:           <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Certs</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)
338:         <span class="ruby-keyword kw">end</span>
339:         
340:       <span class="ruby-keyword kw">end</span>
341:       
342:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">Certificate</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
343:         
344:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Configurable</span>
345:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Descriptor</span>
346:         
347:         <span class="ruby-keyword kw">module</span> <span class="ruby-constant">Flags</span>
348:           
349:           <span class="ruby-constant">CAN_CERTIFY</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
350:           <span class="ruby-constant">ALLOW_DYNAMIC_CONTENT</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">2</span>
351:           <span class="ruby-constant">UNKNOWN_1</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">3</span>
352:           <span class="ruby-constant">ALLOW_HIGH_PRIV_JS</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">4</span>
353:           <span class="ruby-constant">UNKNOWN_2</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">5</span>
354:           <span class="ruby-constant">IS_ROOT_CA</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">6</span>
355:           
356:           <span class="ruby-comment cmt">#~ FULL_TRUST = 1 &lt;&lt; 1 | 1 &lt;&lt; 2 | 1 &lt;&lt; 3 | 1 &lt;&lt; 4 | 1 &lt;&lt; 5 | 1 &lt;&lt; 6</span>
357:           <span class="ruby-constant">FULL_TRUST</span> = <span class="ruby-value">8190</span>
358:         <span class="ruby-keyword kw">end</span>
359: 
360:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:ABEType</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">CERTIFICATE</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
361:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Usage</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
362:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Viewable</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Boolean</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
363:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Editable</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Boolean</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
364:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Cert</span>,          <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">String</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
365:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Trust</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Flags</span><span class="ruby-operator">::</span><span class="ruby-constant">UNKNOWN_2</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
366:         
367:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
368:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ID: #{self.ID}&quot;</span>
369:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Viewable: #{self.Viewable}&quot;</span>
370:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Editable: #{self.Editable}&quot;</span>
371:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Trust attributes: #{self.Trust}&quot;</span>
372:         <span class="ruby-keyword kw">end</span>
373:         
374:       <span class="ruby-keyword kw">end</span>
375:        
376:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_object</span>(<span class="ruby-identifier">no</span>, <span class="ruby-identifier">generation</span> = <span class="ruby-value">0</span>) <span class="ruby-comment cmt">#:nodoc:</span>
377:          
378:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">no</span>
379:         <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Reference</span>
380:           <span class="ruby-identifier">target</span> = <span class="ruby-identifier">no</span>
381:         <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">Integer</span>
382:           <span class="ruby-identifier">target</span> = <span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">no</span>, <span class="ruby-identifier">generation</span>)
383:         <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Origami</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>
384:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">no</span>
385:         <span class="ruby-keyword kw">end</span>
386:        
387:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>[<span class="ruby-identifier">target</span>]
388:       <span class="ruby-keyword kw">end</span>
389:       
390:       <span class="ruby-identifier">private</span>
391:       
392:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rebuildxrefs</span> <span class="ruby-comment cmt">#:nodoc:</span>
393:         
394:         <span class="ruby-identifier">startxref</span> = <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
395:         
396:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
397:           <span class="ruby-identifier">startxref</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
398:         }
399:           
400:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">buildxrefs</span>(<span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>)
401:         
402:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
403:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
404:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">startxref</span>
405:         
406:         <span class="ruby-keyword kw">self</span>
407:       <span class="ruby-keyword kw">end</span>
408:       
409:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">buildxrefs</span>(<span class="ruby-identifier">objects</span>) <span class="ruby-comment cmt">#:nodoc:</span>
410:         
411:         <span class="ruby-identifier">lastno</span> = <span class="ruby-value">0</span>
412:         <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>
413:         
414:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
415:         
416:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
417:         <span class="ruby-identifier">objects</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
418:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
419:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
420:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>
421:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
422:           <span class="ruby-keyword kw">end</span>
423:           
424:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">get_object_offset</span>(<span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span>), <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
425: 
426:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>
427:         }
428:         
429:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
430:         
431:         <span class="ruby-identifier">xrefsection</span>
432:       <span class="ruby-keyword kw">end</span>
433:      
434:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_object_offset</span>(<span class="ruby-identifier">no</span>,<span class="ruby-identifier">generation</span>) <span class="ruby-comment cmt">#:nodoc:</span>
435: 
436:         <span class="ruby-identifier">bodyoffset</span> = <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
437:         
438:         <span class="ruby-identifier">objectoffset</span> = <span class="ruby-identifier">bodyoffset</span>
439:           
440:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
441:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">no</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">generation</span> <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">objectoffset</span>
442:           <span class="ruby-keyword kw">else</span>
443:             <span class="ruby-identifier">objectoffset</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
444:           <span class="ruby-keyword kw">end</span>
445:         }
446:         
447:         <span class="ruby-keyword kw">nil</span>
448:       <span class="ruby-keyword kw">end</span>
449:       
450:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000327" class="method-detail">
        <a name="M000327"></a>

        <div class="method-heading">
          <a href="#M000327" class="method-signature">
          <span class="method-name">Catalog</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000327-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000327-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 124</span>
124:       <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Catalog</span>
125:         <span class="ruby-identifier">get_object</span>(<span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Root</span>)
126:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000335" class="method-detail">
        <a name="M000335"></a>

        <div class="method-heading">
          <a href="#M000335" class="method-signature">
          <span class="method-name">add_certificate</span><span class="method-args">(certfile, attributes, viewable = false, editable = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Add a certificate into the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000335-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000335-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 236</span>
236:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_certificate</span>(<span class="ruby-identifier">certfile</span>, <span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">viewable</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">editable</span> = <span class="ruby-keyword kw">false</span>)
237:         
238:         <span class="ruby-identifier">cert</span> = <span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>
239:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Cert</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">certfile</span>).<span class="ruby-identifier">to_der</span>
240:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">ID</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span>
241:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
242:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Trust</span> = <span class="ruby-identifier">attributes</span>
243:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Viewable</span> = <span class="ruby-identifier">viewable</span>
244:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Editable</span> = <span class="ruby-identifier">editable</span>
245:         
246:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">Entries</span>.<span class="ruby-identifier">push</span>(<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cert</span>)
247:         
248:         <span class="ruby-identifier">show_certs</span>
249:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000325" class="method-detail">
        <a name="M000325"></a>

        <div class="method-heading">
          <a href="#M000325" class="method-signature">
          <span class="method-name">append_subobj</span><span class="method-args">(root, objset)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000325-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000325-source">
<pre>
    <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 83</span>
83:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">objset</span>)
84:           
85:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">objset</span>.<span class="ruby-identifier">find</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">object_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">object_id</span> }.<span class="ruby-identifier">nil?</span>
86:             
87:             <span class="ruby-identifier">objset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">root</span>
88:             
89:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Dictionary</span>)
90:               <span class="ruby-identifier">root</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">subobj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">subobj</span>, <span class="ruby-identifier">objset</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">subobj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>) }
91:             <span class="ruby-keyword kw">end</span>
92:           
93:           <span class="ruby-keyword kw">end</span>
94:           
95:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000332" class="method-detail">
        <a name="M000332"></a>

        <div class="method-heading">
          <a href="#M000332" class="method-signature">
          <span class="method-name">get_cert</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a <a href="AddressBook/Certificate.html">Certificate</a> dictionary
corresponding to the specified id
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000332-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000332-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 209</span>
209:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_cert</span>(<span class="ruby-identifier">id</span>)
210:         
211:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
212:         
213:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000324" class="method-detail">
        <a name="M000324"></a>

        <div class="method-heading">
          <a href="#M000324" class="method-signature">
          <span class="method-name">objects</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000324-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000324-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 81</span>
 81:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">objects</span>
 82:         
 83:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">objset</span>)
 84:           
 85:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">objset</span>.<span class="ruby-identifier">find</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">object_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">object_id</span> }.<span class="ruby-identifier">nil?</span>
 86:             
 87:             <span class="ruby-identifier">objset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">root</span>
 88:             
 89:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Dictionary</span>)
 90:               <span class="ruby-identifier">root</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">subobj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">subobj</span>, <span class="ruby-identifier">objset</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">subobj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>) }
 91:             <span class="ruby-keyword kw">end</span>
 92:           
 93:           <span class="ruby-keyword kw">end</span>
 94:           
 95:         <span class="ruby-keyword kw">end</span>
 96:         
 97:         <span class="ruby-identifier">objset</span> = []
 98:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
 99:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>)
100:             <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">objset</span>)
101:           <span class="ruby-keyword kw">end</span>
102:         }
103:         
104:         <span class="ruby-identifier">objset</span>
105:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000328" class="method-detail">
        <a name="M000328"></a>

        <div class="method-heading">
          <a href="#M000328" class="method-signature">
          <span class="method-name">saveas</span><span class="method-args">(filename)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000328-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000328-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 128</span>
128:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">saveas</span>(<span class="ruby-identifier">filename</span>)
129:         
130:         <span class="ruby-identifier">bin</span> = <span class="ruby-value str">&quot;&quot;</span>
131:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>
132: 
133:         <span class="ruby-identifier">lastno</span>, <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
134:           
135:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
136:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
137:  
138:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
139:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
140:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
141:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
142:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
143:           <span class="ruby-keyword kw">end</span>
144:           
145:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
146:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
147: 
148:           <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_s</span>
149:         }
150:         
151:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
152:         
153:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">xrefsection</span>
154:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
155:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-identifier">rev</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
156:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>
157: 
158:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@xreftable</span>.<span class="ruby-identifier">to_s</span>
159:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">to_s</span>
160: 
161:         <span class="ruby-identifier">fd</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>).<span class="ruby-identifier">binmode</span>
162:           <span class="ruby-identifier">fd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">bin</span> 
163:         <span class="ruby-identifier">fd</span>.<span class="ruby-identifier">close</span>
164:         
165:         <span class="ruby-identifier">show_entries</span>
166:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000331" class="method-detail">
        <a name="M000331"></a>

        <div class="method-heading">
          <a href="#M000331" class="method-signature">
          <span class="method-name">show_cert</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints certificate with the specified id
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000331-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000331-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 198</span>
198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_cert</span>(<span class="ruby-identifier">id</span>)
199:         <span class="ruby-identifier">certs</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
200:         
201:         <span class="ruby-identifier">certs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cert</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> }
202:         
203:         <span class="ruby-keyword kw">nil</span>
204:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000330" class="method-detail">
        <a name="M000330"></a>

        <div class="method-heading">
          <a href="#M000330" class="method-signature">
          <span class="method-name">show_certs</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints registered certificates in the addressbook
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000330-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000330-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 185</span>
185:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_certs</span>
186:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
187:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates list&quot;</span>
188:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
189:         
190:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
191:         
192:         <span class="ruby-keyword kw">nil</span>
193:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000334" class="method-detail">
        <a name="M000334"></a>

        <div class="method-heading">
          <a href="#M000334" class="method-signature">
          <span class="method-name">show_entries</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints users and certificates registered in the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000334-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000334-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 226</span>
226:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_entries</span>
227:         <span class="ruby-identifier">show_users</span>
228:         <span class="ruby-identifier">show_certs</span>
229:         
230:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;End of address book.&quot;</span>
231:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000333" class="method-detail">
        <a name="M000333"></a>

        <div class="method-heading">
          <a href="#M000333" class="method-signature">
          <span class="method-name">show_user</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000333-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000333-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 215</span>
215:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_user</span>(<span class="ruby-identifier">id</span>)
216:         <span class="ruby-identifier">users</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
217:         
218:         <span class="ruby-identifier">users</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> }
219:         
220:         <span class="ruby-keyword kw">nil</span>
221:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000329" class="method-detail">
        <a name="M000329"></a>

        <div class="method-heading">
          <a href="#M000329" class="method-signature">
          <span class="method-name">show_users</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints registered users in the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000329-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000329-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/addressbook.rb, line 171</span>
171:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_users</span>
172:         
173:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
174:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Users list&quot;</span>
175:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
176:         
177:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
178:         
179:         <span class="ruby-keyword kw">nil</span>
180:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000336" class="method-detail">
        <a name="M000336"></a>

        <div class="method-heading">
          <span class="method-name">to_s</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="AddressBook.html#M000334">show_entries</a>
</p>
        </div>
      </div>

      <div id="method-M000337" class="method-detail">
        <a name="M000337"></a>

        <div class="method-heading">
          <span class="method-name">to_str</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="AddressBook.html#M000334">show_entries</a>
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>